<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>垫款批次表 管理</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<form id="capAdvBatch_form">
    <div class="fieldset1 tabel_col tabel_col_1 clearFix">
        
<div class="fieldBox col_100">
	<div class="label">批次号（流水号）</div>
	<div class="field">
		<input name="batchNo" id="batchNo" type="text" class="ui-textbox" value="${capAdvBatchVO.batchNo}" validate="{required:true,maxlength:30}">
		<span class="requiredSymbol">*</span>
	</div>
</div>
<div class="fieldBox col_100">
	<div class="label">垫款规则ID（垫款规则表ID）</div>
	<div class="field">
		<input name="advRuleId" id="advRuleId" type="text" class="ui-textbox" value="${capAdvBatchVO.advRuleId}" validate="{required:true,number:true}">
		<span class="requiredSymbol">*</span>
	</div>
</div>
<div class="fieldBox col_100">
	<div class="label">垫款/核销总金额</div>
	<div class="field">
		<input name="advTtlAmt" id="advTtlAmt" type="text" class="ui-textbox" value="${capAdvBatchVO.advTtlAmt}" validate="{required:true,number:true}">
		<span class="requiredSymbol">*</span>
	</div>
</div>
<div class="fieldBox col_100">
	<div class="label">垫款/核销方式CAP0037：1.自动 2.手动</div>
	<div class="field">
		<select name="advTypCd" id="advTypCd" data-value="${capAdvBatchVO.advTypCd}" validate="{required:true,select:true}">
	<option value=" ">请选择</option>
	<c:forEach items="${advTypCdList}" var="item">
		<option value="${item.code }">${item.codeNm }</option>
	</c:forEach>
		</select>
		<span class="requiredSymbol">*</span>
	</div>
</div>
    </div>
    <div class="btnsBox">
        <span id="saveCapAdvBatch_Btn" class="sq-button sq-button-round l-dialog-btn-ok">保存</span>
        <input type="reset" id="resetBtn" class="l-button l-button-reset Hide">
    </div>
</form>
<script>
    $(function() {
        var capAdvBatchId = "${capAdvBatchVO.id}";//主键ID
        $("#capAdvBatch_form").ligerForm({
            validate: true
        });
        /*保存*/
        $("#saveCapAdvBatch_Btn").click(function (event) {
            var form = liger.get("capAdvBatch_form");
            if (!form.valid()) {
                $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
                return false; //验证不通过，不执行以下代码
            }
            var data = form.getData();
            $.ligerDialog.hide();
            var _url;
            if (capAdvBatchId == '') {//新增
                _url = '<%=path%>/capital/capAdvBatch/add.do';
            } else {//修改
                _url = '<%=path%>/capital/capAdvBatch/modify.do?id=' + capAdvBatchId;
            }
            var wait_dialog;
            $.ajax({
                type: 'post',
                dataType: 'json',
                data: data,
                url: _url,
                beforeSend: function () {
                    wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
                },
                success: function (msg) {
                    wait_dialog.close();
                    if (msg.success == 1) {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                        parent.$("#clearBtn").click();
                        parent.$("#searchBtn").click();
                        frameElement.dialog.close();
                        
                        //$("#resetBtn").click();
                        //回调刷新列表
                        //var callback=frameElement.W2W.callback;
                        //Remove_navTab();
                        //callback();
                    } else {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                    }
                }
            });
        });
    });
</script>
</body>
</html>
